home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / system / ms_sh22b.zip / src / Makefile < prev    next >
Makefile  |  1993-12-01  |  8KB  |  276 lines

  1. #
  2. # MS-DOS SHELL - Makefile
  3. #
  4. # MS-DOS SHELL - Copyright (c) 1990,1,2 Data Logic Limited.
  5. #
  6. # Redistribution and use in source and binary forms are permitted
  7. # provided that the above copyright notice is duplicated in the
  8. # source form.
  9. #
  10. #
  11. #    $Header: /usr/users/istewart/src/shell/sh2.2/RCS/makefile,v 2.6 1993/08/25 16:03:57 istewart Exp $
  12. #
  13. #    $Log: makefile,v $
  14. # Revision 2.6  1993/08/25  16:03:57  istewart
  15. # Beta 225 - see Notes file
  16. #
  17. # Revision 2.5  1993/07/02  10:25:53  istewart
  18. # 224 Beta fixes
  19. #
  20. # Revision 2.4  1993/06/16  12:55:32  istewart
  21. # Expand a bit on the required environment variables
  22. #
  23. # Revision 2.3  1993/06/14  10:59:32  istewart
  24. # More changes for 223 beta
  25. #
  26. # Revision 2.0  1992/04/13  17:40:33  Ian_Stewartson
  27. # MS-Shell 2.0 Baseline release
  28. #
  29. #
  30. # This makefile builds four versions of the shell:
  31. #
  32. #  MSDOS - 16 bit
  33. #  MSDOS - 32 bit (shell does not work).  The extender core dumps.
  34. #  OS/2 - 16 bit
  35. #  OS/2 - 32 bit
  36. #
  37. # You need to select $(CC) as follows:
  38. #
  39. # Set CC to the compiler:
  40. #
  41. #    icc    - IBM C Set/2
  42. #    cl     - Microsoft C 5.1 or C6.0
  43. #    tcc    - Borland Turbo C
  44. #    wcc386 - WATCOM C 386 (for the MSDOS 32-bit version).
  45. #
  46. # Set up the environment variables for the compiler to find its include and
  47. # lib directories.  Normally, these variables are INCLUDE and LIB.
  48. #
  49. # The makefile assumes you are re-building the shell, using the shell as
  50. # the primary command line processor.  Hence the OSMODE variable which
  51. # indicates if you are building on MSDOS or OS/2.
  52. #
  53. # I use Microsoft as the main development environment, so I have a
  54. # variable TFLAG_MSC which tells the makefile whether I want to build the
  55. # optimised (-Olt) or debug (-Zid) version.  For OS/2 2.x, I've used the
  56. # IBM C Set/2 and a variable TFLAG_IBM with values -O or -(debug options).
  57. #
  58. # BETA is set to the release name (V2xxBeta) or RELEASE.
  59. #
  60. # You may need to uncomment one or more following, if the associated environment
  61. # variable is to something else.
  62. #
  63. #SHELL=/bin/sh
  64. #BETA=RELEASE
  65. #CC=cl
  66. #OSMODE=0
  67. #TFLAG_MSC=-Olt
  68. #TFLAG_IBM=-O
  69. #TFLAG_WAT=-olt
  70. #TFLAG_WAT=-d2
  71. #ASDEBUG=/Zi /Zd
  72.  
  73.  
  74. LINK=/BATCH/NOLOGO/FARCALL/NOE/ST:8000
  75.  
  76. #
  77. # MSDOS build options
  78. #
  79.  
  80. MSC_DOS_16_Options=-AL $(TFLAG_MSC) -Iinclude -W3 -nologo
  81. TC_DOS_16_Options=-ml -Iinclude -N -Z -G -O -wpro -wuse -w-par -w-pia
  82. WAT_DOS_32_Options=-mf -Iinclude -zq $(TFLAG_WAT)
  83.  
  84. #
  85. # OS/2 1.x build options using Microsoft C6.0
  86. #
  87.  
  88. MSC_OS2_16_Options=-AL $(TFLAG_MSC) -W3 -DOS2 -nologo
  89.  
  90. #
  91. # OS/2 2.x build options using IBM C Set/2 1.0 or WATCOM 9.0
  92. #
  93. # Note the WATCOM options for OS/2 and DOS 32-bit mode are the same.
  94. #
  95.  
  96. IBM_OS2_32_Options=-Q $(TFLAG_IBM) -Sm -Iinclude
  97. WAT_OS2_32_Options=-mf -Iinclude -zq $(TFLAG_WAT)
  98.  
  99. #
  100. # Objects and sources
  101. #
  102.  
  103. OBJS=    sh1.obj sh2.obj sh3.obj sh4.obj sh5.obj sh7.obj sh8.obj    \
  104.     sh9.obj sh10.obj sh11.obj sh12.obj sh13.obj sh6.obj
  105. OBJS2=    stdargv.obj glob.obj director.obj
  106.  
  107. SRCS=    sh0.asm sh1.c sh2.c sh3.c sh4.c sh5.c sh6.c sh7.c sh8.c    \
  108.     sh9.c sh10.c sh11.c sh12.c sh13.c
  109.  
  110. SRCS2=    stdargv.c glob.c director.c
  111.  
  112. #
  113. # Targets
  114. #
  115.  
  116. all:    sh
  117. ps:    ps.exe
  118. system: system.exe
  119. showkey: showkey.exe
  120.  
  121. sh6.obj: sh6.c  $(SRCS)
  122.     @echo Building sh6.c 1>&2;                    \
  123.     CFLAGS=-c;                            \
  124.     if [ $(CC) = "icc" ];                        \
  125.     then CFLAGS="-c $(IBM_OS2_32_Options)";                \
  126.     elif [ $(CC) = "tcc" ];                        \
  127.     then CFLAGS="-c $(TC_DOS_16_Options)";                \
  128.     elif [ $(CC) = "wcc386" ];                    \
  129.     then CFLAGS="$(WAT_DOS_32_Options)";                \
  130.     elif [ $(OSMODE) = 0 ];                        \
  131.     then export CL="$(MSC_DOS_16_Options)";                \
  132.     else export CL="$(MSC_OS2_16_Options)";                \
  133.     fi;                                \
  134.     $(CC) $$CFLAGS -DRELEASE=$(BETA) sh6.c
  135.  
  136. #
  137. # Build sh0.asm
  138. #
  139.  
  140. sh0.obj: sh0.asm
  141.     @if   [ $(OSMODE) = 0 -a $(CC) != "wcc386" ];            \
  142.     then  echo Building sh0.obj 1>&2;                \
  143.           if   [ $(CC) = "tcc" ];                    \
  144.           then ASFLAGS="/D__TURBOC__=1 /t /Ml";            \
  145.           else ASFLAGS="/t /Ml";                    \
  146.           fi;                            \
  147.           $(AS) $$ASFLAGS $(ASDEBUG) 'sh0.asm;';            \
  148.     fi
  149.  
  150. sh0.all:
  151.     $(AS) /t /Ml sh0.asm  'sh0_msc;'
  152.     $(AS) /D__TURBOC__=1 /t /Ml sh0.asm  'sh0_tc;'
  153.  
  154. #
  155. # Build sh0.asm
  156. #
  157.  
  158. swap.obj: swap.asm
  159.     @if   [ $(OSMODE) = 0 ];                    \
  160.     then echo Building swap.obj 1>&2;                \
  161.          if [ $(CC) = "tcc" ];                    \
  162.          then ASFLAGS="/D__TURBOC__=1 /t /Ml";            \
  163.          else ASFLAGS="/t /Ml";                    \
  164.          fi;                            \
  165.          $(AS) $$ASFLAGS 'swap.asm;'                \
  166.     fi
  167.  
  168.  
  169. #
  170. # Any .obj.
  171. #
  172. .c.obj:
  173.     @echo Building $< 1>&2;                        \
  174.     CFLAGS=-c;                            \
  175.     if [ $(CC) = "icc" ];                        \
  176.     then CFLAGS="-c $(IBM_OS2_32_Options)";                \
  177.     elif [ $(CC) = "tcc" ];                        \
  178.     then CFLAGS="-c $(TC_DOS_16_Options)";                \
  179.     elif [ $(CC) = "wcc386" ];                    \
  180.     then CFLAGS="$(WAT_DOS_32_Options)";                \
  181.     elif [ $(OSMODE) = 0 ];                        \
  182.     then export CL="$(MSC_DOS_16_Options)";                \
  183.     elif [ $(TFLAG_MSC) = "-Olt" ];                    \
  184.     then export CL="$(MSC_OS2_16_Options)";                \
  185.     else export CL="$(MSC_OS2_16_Options) -DOS2_DOSALLOC";        \
  186.     fi;                                \
  187.     $(CC) $$CFLAGS $<
  188.  
  189.  
  190. sh: $(OBJS) sh0.obj
  191.     @echo Linking 1>&2;                        \
  192.     if   [ $(CC) = "icc" ];                        \
  193.     then $(CC) -Fe shos232.exe -Q $(TFLAG_IBM) -Sm $(OBJS)        \
  194.            sh.def -B /BAT;                    \
  195.          if [ "$(TFLAG_IBM)" = "-O" ];                \
  196.          then msgbind sh.bnd;                    \
  197.          fi;                            \
  198.     elif [ $(CC) = "wcc386" ];                    \
  199.     then if   [ $(TFLAG_WAT) = "-d2" ];                \
  200.          then wlink @wsh$(OSMODE)d.lnk;                \
  201.          else wlink @wsh$(OSMODE).lnk;                \
  202.          fi;                            \
  203.     elif [ $(CC) = "tcc" ];                        \
  204.     then tlink /c/e @tsh.lnk;                    \
  205.          exehdr shdos16.exe -stack:0x8000;                \
  206.          ?=0;                            \
  207.     elif [ "$(TFLAG_MSC)" = "-Olt" ];                \
  208.     then link /batch @msh$(OSMODE).lnk;                \
  209.     else link /batch @msh$(OSMODE)d.lnk;                \
  210.     fi
  211.  
  212. all3:    swap.obj system.obj
  213.     cl -F 8000 -o system swap system
  214.  
  215. ps.exe: ps.obj $(OBJS2)
  216.     @if [ $(OSMODE) = 1 ];                        \
  217.     then echo Linking ps 1>&2;                    \
  218.          if   [ $(CC) = "icc" ];                    \
  219.          then CFLAGS="-Q $(TFLAG_IBM) -Sm";                \
  220.               $(CC) $$CFLAGS -Fe ps.exe ps.obj $(OBJS2) sh.def;    \
  221.          elif [ $(CC) = "wcc386" ];                    \
  222.          then wlink @ps.lnk;                    \
  223.          elif [ $(CC) = "cl" ];                    \
  224.          then export CL="$(MSC_DOS_16_Options)";            \
  225.               $(CC) -o ps.exe ps.obj $(OBJS2) sh.def -link $(LINK);    \
  226.          fi;                            \
  227.     fi
  228.         
  229. system.obj: system.c
  230.     @CFLAGS=;                            \
  231.     echo Building system.obj 1>&2;                    \
  232.     if [ $(CC) = "icc" ];                        \
  233.     then CFLAGS="$(IBM_OS2_32_Options)";                \
  234.     elif [ $(OSMODE) = 0 ];                        \
  235.     then export CL="$(MSC_DOS_16_Options)";                \
  236.     else export CL="$(MSC_OS2_16_Options)";                \
  237.     fi;                                \
  238.     $(CC) $$CFLAGS -c -DTEST system.c
  239.  
  240. system.exe: system.obj director.obj swap.obj
  241.     @echo Linking system 1>&2;                    \
  242.     if [ $(CC) = "icc" ];                        \
  243.     then $(CC) -Q $(TFLAG_IBM) -Sm -Fe system.exe director.obj    \
  244.                        system.obj;            \
  245.     elif [ $(OSMODE) = 0 ];                        \
  246.     then export CL="$(MSC_DOS_16_Options)";                \
  247.          $(CC) -o system.exe swap.obj director.obj system.obj    \
  248.             -link $(LINK);                    \
  249.     else export CL="$(MSC_OS2_16_Options)";                \
  250.          $(CC) -o system.exe director.obj system.obj -link $(LINK);    \
  251.     fi
  252.  
  253. showkey.exe: showkey.obj
  254.     @echo Linking showkey 1>&2;                    \
  255.     if [ $(CC) = "icc" ];                        \
  256.     then $(CC) -Q $(TFLAG_IBM) -Sm -Fe showkey.exe showkey.obj;    \
  257.     elif [ $(OSMODE) = 0 ];                        \
  258.     then export CL="$(MSC_DOS_16_Options)";                \
  259.          $(CC) -o showkey.exe showkey.obj -link $(LINK);        \
  260.     else export CL="$(MSC_OS2_16_Options)";                \
  261.          $(CC) -o showkey.exe showkey.obj -link $(LINK);        \
  262.     fi
  263.  
  264. director.exe: 
  265.     @echo Linking director 1>&2;                    \
  266.     if [ $(CC) = "icc" ];                        \
  267.     then $(CC) -Q $(TFLAG_IBM) -DTEST -Sm -Fe director.exe        \
  268.         director.c;                        \
  269.     elif [ $(CC) = "cl" ];                        \
  270.     then if [ $(OSMODE) = 0 ];                    \
  271.          then export CL="$(MSC_DOS_16_Options)";            \
  272.          else export CL="$(MSC_OS2_16_Options)";            \    
  273.          fi;                            \
  274.          $(CC) -o director.exe director.c -link $(LINK);        \
  275.     fi
  276.